//
//  GestionPersonController.h
//  Cabinet
//
//  Created by Florent Montsegur on 21/10/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "PersonArrayController.h" 
#import "VaccinArrayController.h"
#import "ConsultationArrayController.h"
#import "Person.h"
#import "JumellageController.h"

@interface GestionPersonController : NSWindowController<NSTextViewDelegate, NSTableViewDelegate>{
@private
    
    NSManagedObjectContext *mManagedObjectContext;
    
    NSWindow *__unsafe_unretained mConfSuppPersonneWnd;
    NSWindow *__unsafe_unretained mConfSuppVaccinationWnd;
    NSWindow *__unsafe_unretained mConfSuppConsulationWnd;
    
    NSTextView *__unsafe_unretained mPersonneInfos;
    
    PersonArrayController *__unsafe_unretained mPersons;
    VaccinArrayController *__unsafe_unretained mVaccins;
    ConsultationArrayController *__unsafe_unretained mConsultations;
    
    NSWindow *__unsafe_unretained mRapportWnd;
    NSTextView *__unsafe_unretained mRapportTxt;
    
    NSWindow *__unsafe_unretained mDossierMedtWnd;
    NSTextView *__unsafe_unretained mDossierMedTxt;
    
    JumellageController *mJumellageControllerWnd;
}

@property (nonatomic, strong) NSManagedObjectContext * mManagedObjectContext;
@property (unsafe_unretained) IBOutlet NSWindow *mConfSuppPersonneWnd;
@property (unsafe_unretained) IBOutlet NSWindow *mConfSuppVaccinationWnd;
@property (unsafe_unretained) IBOutlet NSWindow *mConfSuppConsulationWnd;
@property (unsafe_unretained) IBOutlet NSTextView *mPersonneInfos;
@property (unsafe_unretained) IBOutlet NSWindow *mRapportWnd;
@property (unsafe_unretained) IBOutlet NSTextView *mRapportTxt;
@property (unsafe_unretained) IBOutlet PersonArrayController *mPersons;
@property (unsafe_unretained) IBOutlet VaccinArrayController *mVaccins;
@property (unsafe_unretained) IBOutlet ConsultationArrayController *mConsultations;
@property (strong) IBOutlet NSButton *mJumeller;
@property (strong) IBOutlet NSBox *mInformations;
@property (unsafe_unretained) IBOutlet NSWindow *mDossierMedWnd;
@property (unsafe_unretained) IBOutlet NSTextView *mDossierMedTxt;

// NSTextViewDelegate
- (void)textDidChange:(NSNotification *)aNotification;
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification;

- (IBAction)supprimerPersonneAction:sender;
- (IBAction)supprimerVaccinationAction:sender;
- (IBAction)supprimerConsultationAction:sender;
- (IBAction)printRapportAction:sender;
- (IBAction)jumellerAction:sender;
- (IBAction)printDossierMedAction:sender;

-(void) setObjEnabled:(NSObject *)Obj withState:(bool)Enabled;
-(void) ajouterInformationsRapport:(NSMutableAttributedString *)aText font:(NSFont *)aFont person:(Person *)pPerson;
-(void) ajouterVaccinsRapport:(NSMutableAttributedString *)aText font:(NSFont *)aFont person:(Person *)pPerson;
-(void) ajouterActesRapport:(NSMutableAttributedString *)aText font:(NSFont *)aFont person:(Person *)pPerson;
-(void) ajouterTitreRapport:(NSMutableAttributedString *)aText font:(NSFont *)aFont titre:(NSString *)aTitre;

@end
